package com.ktwlsoft.archivemanage.domain.dao.repository;

import com.ktwlsoft.archivemanage.domain.dao.entity.Role;
import com.ktwlsoft.archivemanage.domain.dao.entity.UserRoleRelation;
import com.ktwlsoft.archivemanage.payload.role.EditRoleRequest;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 用户角色关系
 *
 * @author LanJian
 */
@Mapper
public interface IUserRolesMapper {

    List<Role> findRolesByAccountId(long accountId);

    /**
     * 插入 on 2019-10-24 14:19:41
     * @param userRoleRelation userRoleRelation
     * @return int
     */
    int insert(UserRoleRelation userRoleRelation);

    /**
     * 更新 on 2019-10-24 14:19:41
     * @param userRoleRelation userRoleRelation
     * @return int
     */
    int update(UserRoleRelation userRoleRelation);

    /**
      * 根据账号id查询 on 2019/10/31 17:33
      *
      * @param accountId accountId
      * @return List<UserRoleRelation>
      */
    List<UserRoleRelation> getByAccountId(Long accountId);

    /**
     * 根据id集合批量删除信息 on 2019-10-24 14:19:41
     * @param ids ids
     * @return int
     */
    int deleteByIds(List<Long> ids);

    int updateRoleInfo(EditRoleRequest request);

    List<UserRoleRelation> findByRoleId(Long roleId);
}
